home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / allmac21.arc / COLUMN10.ARC / COLUMN10.QM < prev    next >
Text File  |  1990-08-27  |  15KB  |  394 lines

  1. *                           COLUMN10.QM, v1.0e
  2. *
  3. * The following macros produce a single column of the commands
  4. * contained in a txtfile converted from a macfile by QMAC:
  5. *
  6. * @1 - slowest, may need editing
  7. * @2 - does not use batch files, requires no editing
  8. * @3 - fastest and smallest (103 bytes), uses batch files included,
  9. *      requires no editing. ** RECOMMEND @3 as macro to use **
  10. *
  11. * You may find these macros useful in understanding how a macro
  12. * works, or if you want to modify a QMAC txtfile, it may be a little
  13. * easier to do so with commands in a single column.
  14. *
  15. * Insert must be ON. Change "C:" to ram drive for faster operation.
  16. *
  17. * VERSION HISTORY:
  18. *
  19. *       1.0  - initial
  20. *       1.0a - reduced size
  21. *       1.0b - modified to reduce editing for quotes and spaces
  22. *       1.0c - documentation changed
  23. *       1.0d - added @2 & @3
  24. *       1.0e - minor documentation changes
  25. *            - changed file name dum to c:$
  26. *
  27.  
  28.  
  29. *┌────────────────────────────────────────────────────────────┐
  30. *│The following txtfile was converted by QMAC from @1         │
  31. *└────────────────────────────────────────────────────────────┘
  32. *
  33.  
  34. @1      MacroBegin UnmarkBlock InsertLine MarkColumn CurrentFilename
  35.         StoreScrbuff "1" Return DelLine CursorDown PrevPara
  36.         MarkBlockBegin EndPara MarkBlockEnd FindReplace """ """
  37.         Return """\""" Return "LN" Return FindReplace """  """ Return
  38.         """\\""" Return "LN" Return PrevPara BegLine WordRight
  39.         Label2: CursorLeft Find " " Return "L" Return Return Label1:
  40.         CursorLeft JFalse Label0: DelCh Jump Label1: Label0: Find " "
  41.         Return "L" Return JTrue Label2: GotoBlockBeg MarkColumn
  42.         PrevPosition MarkColumn PrevPosition Label4: Find " " Return
  43.         "L" Return JFalse Label3: DelCh Jump Label4: Label3:
  44.         GotoColumn "60" Return MarkColumn GotoBlockBeg CursorDown
  45.         MarkBlockBegin ShiftRight RepeatCmd "7" Return CursorUp
  46.         MarkBlockBegin Cut EditFile "c:$" Return KillFile Quit
  47.         EditFile Return Paste BegFile Label6: EndPara CursorDown
  48.         JFalse Label5: Label7: EndLine BegLine JTrue Label6: DelLine
  49.         JTrue Label7: Label5: SaveFile GetScrbuff "1" Return Cut
  50.         EditFile Paste Return ReadBlock "c:$" Return FindReplace "\"
  51.         Return " " Return "LN" Return GotoBlockBeg
  52.  
  53. * 187 bytes Thu  08-23-1990  14:26:18
  54.  
  55.  
  56.  
  57.  
  58.  
  59. * ┌────────────────────────────────────────────────────────────────┐
  60. * │@1 Makes single column of commands from QMAC txtfile            │
  61. * └────────────────────────────────────────────────────────────────┘
  62. * Here's a handy macro to convert QMAC txtfiles to a single column of
  63. * commands. After running this macro by placing the cursor line
  64. * anywhere in any QMAC produced txtfile you should see a single column
  65. * of commands.
  66. *
  67. * An earlier version 1.0 of this macro required editing of macro
  68. * commands containing "space" ( quote space quote). This macro
  69. * produces a single column macro that, when converted by QMAC, requires
  70. * less editing, even though some editing still may be required after
  71. * running depending on the macro. Any command containing 'd:\path' is
  72. * still split into two lines requiring editing. Other combination of
  73. * quotes and spaces and other commands may also need editing. I am sure
  74. * there are more.
  75. *
  76. * Macros to be converted to single column with @1 must have blank
  77. * lines at begin and end. CAUTION: immediately after running this
  78. * macro, test it by converting the QMAC single column txtfile to a
  79. * macfile, and edit those lines that did not convert correctly. Then
  80. * convert the single column txtfile back to a macfile, read it, and
  81. * run as a test. Macros @2 & @3 were written after realizing the
  82. * shortcomings and complexities of @1. I guess some of us tend
  83. * to make things complicated at first until we figure out how to
  84. * make them simple and foolproof!
  85.  
  86.  
  87. @1 macrobegin
  88. ***************************************** GET FILENAME TO SCRBUFF 1
  89.         unmarkblock                     * unmarkblock
  90.         insertline                      * insert temp line
  91.         markcolumn                      * markcolumn
  92.         currentfilename                 * get currentfilename
  93.         storescrbuff "1" return         *   to scrbuff 1
  94.         delline                         * delete temp line
  95. ***************************************** BREAK MACRO INTO COLUMN
  96.         cursordown                      * move down one line
  97.         prevpara                        * get to begin para
  98.         markblockbegin                  * mark begin para
  99.         endpara                         * 
  100.         markblockend                    * mark end para
  101.         findreplace                     * replace
  102.         #34 #32 #34 return              * " "
  103.         #34 #92 #34 return              * with "\"
  104.         "LN" return                     * block only
  105.          findreplace                    * replace
  106.         #34 #32 #32 #34 return          * "  "
  107.         #34 #92 #92 #34 return          * with "\\"
  108.         "LN" return                     * block only
  109.         prevpara                        *
  110.         begline                         * get back to begin para
  111.         wordright                       * get to key
  112.  STARTSPACE:                            *
  113.         cursorleft                      * get off word
  114.         find " " return "L" return      * find next space
  115.         return                          * puts command on next line
  116. ***************************************** LINE UP COMMANDS IN COL 1
  117.  BEGINSPACE:                            *
  118.         cursorleft                      * get off command
  119.  jfalse DONESPACE:                      *
  120.         delch                           * delete blank space to col 1
  121.  jump BEGINSPACE:                       *
  122.  DONESPACE:                             *
  123.         find " " return "L" return      * look for more single spaces
  124.  jtrue STARTSPACE:                      * go find next command
  125. ***************************************** MARK COLUMN 1 AS BLOCK
  126.         gotoblockbeg                    * get to col 1 2nd line
  127.         markcolumn                      * mark it
  128.         prevposition                    * get to bottom line col 1
  129.         markcolumn                      * mark it
  130.         prevposition                    * go bak to line 2
  131. ***************************************** DELETE BLANK SPACES IN COL 1
  132.   AGAIN:                                *
  133.         find " " return "L" return      * find first blank space down
  134.   jfalse NEXT:                          * get ready to shiftright
  135.         delch                           * delete it
  136.   jump AGAIN:                           * look for more
  137.   NEXT:                                 *
  138. ***************************************** SHIFT RIGHT/ CUT TO TEMP
  139.         gotocolumn "60" return          * get long commands in block
  140.         markcolumn                      * mark end
  141.         gotoblockbeg                    * go back to block begin
  142.         cursordown                      * drop down 1 to shift rest
  143.         markblockbegin                  * mark block to shift
  144.         shiftright                      * shift all but line 1 right
  145.         repeatcmd "7" return
  146.         cursorup                        * get back to block begin
  147.         markblockbegin                  * get line 1 in block
  148.         cut                             * cut lined up block to scrap
  149.         editfile "c:$" return           * find tempfile in ring
  150.         killfile                        * kill it on disk
  151.         quit                            * quit ring
  152.         editfile  return                * edit new tempfile
  153.         paste                           * paste lined up block to temp
  154. *************************************** * REMOVE BLANK LINES IN BLOCK
  155.         begfile                         *
  156.  NOTBLANK:                              *
  157.         endpara                         *
  158.         cursordown                      *
  159.  jfalse NOMORE:                         *
  160.  BLANK:                                 *
  161.         endline                         *
  162.         begline                         *
  163.  jtrue  NOTBLANK:                       *
  164.         delline                         *
  165.  jtrue BLANK:                           *
  166.  NOMORE:                                *
  167.  **************************************** GET BLOCK BACK TO FILE
  168.         savefile                        * save tempfile to disk
  169.         getscrbuff "1" return           * get currentfilename
  170.         cut                             * cut to scrap
  171.         editfile paste return           * load orig file
  172.         readblock "c:$" return          * read block/no blnk lines
  173.         findreplace #92 return          * replace \
  174.        #32 return "LN" return           * with space
  175. ***************************************** INDENT LABELS
  176.  END:                                   *
  177.         gotoblockbeg                    *
  178.  
  179. * 187 bytes Thu  08-23-1990  14:26:38
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186. * ┌─────────────────────────────────────────────────────────────┐
  187. * │The following txtfile was produced when @1 is run            │
  188. * │with cursor line in the QMAC txtfile at the beginning        │
  189. * └─────────────────────────────────────────────────────────────┘
  190. * (asterisks added Thu  08-23-1990  )
  191. *
  192. * @1
  193. *         MacroBegin
  194. *         UnmarkBlock
  195. *         InsertLine
  196. *         MarkColumn
  197. *         CurrentFilename
  198. *         StoreScrbuff
  199. *         "1"
  200. *         Return
  201. *         DelLine
  202. *         CursorDown
  203. *         PrevPara
  204. *         MarkBlockBegin
  205. *         EndPara
  206. *         MarkBlockEnd
  207. *         FindReplace
  208. *         """ """
  209. *         Return
  210. *         """ """
  211. *         Return
  212. *         "LN"
  213. *         Return
  214. *         FindReplace
  215. *         """  """
  216. *         Return
  217. *         """  """
  218. *         Return
  219. *         "LN"
  220. *         Return
  221. *         PrevPara
  222. *         BegLine
  223. *         WordRight
  224. *         Label2:
  225. *         CursorLeft
  226. *         Find
  227. *         " "
  228. *         Return
  229. *         "L"
  230. *         Return
  231. *         Return
  232. *         Label1:
  233. *         CursorLeft
  234. *         JFalse
  235. *         Label0:
  236. *         DelCh
  237. *         Jump
  238. *         Label1:
  239. *         Label0:
  240. *         Find
  241. *         " "
  242. *         Return
  243. *         "L"
  244. *         Return
  245. *         JTrue
  246. *         Label2:
  247. *         GotoBlockBeg
  248. *         MarkColumn
  249. *         PrevPosition
  250. *         MarkColumn
  251. *         PrevPosition
  252. *         Label4:
  253. *         Find
  254. *         " "
  255. *         Return
  256. *         "L"
  257. *         Return
  258. *         JFalse
  259. *         Label3:
  260. *         DelCh
  261. *         Jump
  262. *         Label4:
  263. *         Label3:
  264. *         GotoColumn
  265. *         "60"
  266. *         Return
  267. *         MarkColumn
  268. *         GotoBlockBeg
  269. *         CursorDown
  270. *         MarkBlockBegin
  271. *         ShiftRight
  272. *         RepeatCmd
  273. *         "7"
  274. *         Return
  275. *         CursorUp
  276. *         MarkBlockBegin
  277. *         Cut
  278. *         EditFile
  279. *         "c:$"
  280. *         Return
  281. *         KillFile
  282. *         Quit
  283. *         EditFile
  284. *         Return
  285. *         Paste
  286. *         BegFile
  287. *         Label6:
  288. *         EndPara
  289. *         CursorDown
  290. *         JFalse
  291. *         Label5:
  292. *         Label7:
  293. *         EndLine
  294. *         BegLine
  295. *         JTrue
  296. *         Label6:
  297. *         DelLine
  298. *         JTrue
  299. *         Label7:
  300. *         Label5:
  301. *         SaveFile
  302. *         GetScrbuff
  303. *         "1"
  304. *         Return
  305. *         Cut
  306. *         EditFile
  307. *         Paste
  308. *         Return
  309. *         ReadBlock
  310. *         "c:$"
  311. *         Return
  312. *         FindReplace
  313. *         " "
  314. *         Return
  315. *         " "
  316. *         Return
  317. *         "LN"
  318. *         Return
  319. *         GotoBlockBeg
  320. *
  321. * * 187 bytes Sun  08-05-1990  17:45:24
  322.  
  323.  
  324.  
  325.  
  326. * ┌───────────────────────────────────────────────────────────┐
  327. * │@2 Makes single column txtfile from any txtfile.           │
  328. * │   Does not use batch files.                               │
  329. * └───────────────────────────────────────────────────────────┘
  330. *    Does the same as @1 but faster. Requires no editing.
  331. *    If a macros is not a marked block, the full txtfile is made
  332. *    into a single column macro.
  333.  
  334. @2 macrobegin
  335.         writeblock "c:$.qm"             * copy block or file to c:$.qm
  336.         return return                   *
  337. ***************************************** GET CURRENTFILENAME TO SCRAP
  338.         unmarkblock
  339.         insertline                      * insert blank line
  340.         begline                         *
  341.         dropanchor                      * start mark
  342.         currentfilename                 * get currentfilename
  343.         storescrbuff "1" return         * to scrbuff 1
  344.         cut                             * to scrap
  345. ****************************************
  346.         dos "QMAC c:$.mac c:$.qm /B /A- "      return return * make macfile
  347.         dos "QMAC c:$.mac c:$.qm /T /A- /W15 " return return * make txtfile
  348.         editfile "c:$.qm" return quit   *
  349.         editfile return                 * load c:$.qm
  350.         endfile return                  * insert blank line at end
  351.         "*" insertdate inserttime       * for date/time
  352.         getscrbuff "1" return           * and file name
  353.         unmarkblock                     *
  354.         savefile                        * save c:$.qm
  355.  
  356. * 182 bytes Thu  08-23-1990  14:27:02
  357.  
  358.  
  359.  
  360.  
  361. * ┌────────────────────────────────────────────────────────┐
  362. * │@3 Makes single column txtfile from any txtfile         │
  363. * │   Uses batch files QMACB.BAT and QMACT-N.BAT           │
  364. * └────────────────────────────────────────────────────────┘
  365. *    Smallest, 102 bytes. Requires no editing.
  366. *    If a macro is not a marked block, the full txtfile is made
  367. *    into a single column macro.
  368.  
  369.  
  370. @3 macrobegin
  371.         writeblock "c:$.qm"             * copy block or file to c:$.qm
  372.         return return                   *
  373. ***************************************** GET CURRENTFILENAME TO SCRAP
  374.         insertline                      * insert blank line
  375.         begline                         *
  376.         dropanchor                      * start mark
  377.         currentfilename                 * get currentfilename
  378.         storescrbuff "1" return         * to scrbuff 1
  379.         cut                             * to scrap
  380. *****************************************
  381.         dos "qmacb c:$"  return  return * make macfile
  382.         dos "qmact-n c:$" return return * make txtfile
  383.         editfile "c:$.qm" return quit   *
  384.         editfile return                 * load c:$.qm
  385.         endfile return                  * insert blank line at end
  386.         "*" insertdate inserttime       * for date/time
  387.         getscrbuff "1" return           * and file name
  388.         unmarkblock                     *
  389.         savefile                        * save c:$.qm
  390.  
  391. * 103 bytes Sun  08-05-1990  17:50:06
  392.  
  393. * Tom Hogshead  Thu  08-23-1990  13:50:17
  394.